<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>两栏布局</title>
    <style>
        html{
            background-color: khaki;
        }
        body {
            background-color: lightblue;
            /* body将会占据90%的视口宽度，直到达到1024像素 */
            width: 90%;
            max-width: 1024px;
            margin: 0 auto;
        }

        header {
            background-color: greenyellow;
        }

        main div:nth-child(1) {
            float:left;
            width: 70%;
            border: 1px solid black;
            /* padding: 5px;
            margin-left: 5px; */
        }

        main div:nth-child(2) {
            float:right;
            width: 28%;
            border: 1px solid black;
            /* padding: 5px;
            margin-right: 5px; */
        }

        footer {
            clear: both;
            background-color: gray;
            text-align: center;
            padding:10px;
        }

        

    </style>
</head>
<body>
    <header><h1>两栏自适应布局</h1></header>
    <main>
        <div>
            <h2>左边栏</h2>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officiis nemo, molestias sunt eum laudantium blanditiis ea vel sapiente harum omnis amet, illo aspernatur porro cumque fuga voluptas consequuntur unde iste?</p>
        </div>
        <div>
            <h2>右边栏</h2>
            <p>Nesciunt consectetur aspernatur iusto cum quaerat alias quae iste repellat nostrum pariatur maiores temporibus doloribus accusamus veritatis debitis impedit, hic illum. Consectetur fugit facilis earum sequi sunt, architecto harum similique!</p>
        </div>
    </main>
    <footer>底部</footer>

</body>
</html>